﻿using System;
using System.Collections.Generic;
using System.Text;
using Ganosoft.DynamicProxy;

namespace GanoESB.Component
{
    internal class ExecutingInterceptor : IInterceptor
    {
        private ServiceDescriptor descr;
        private object target;

        public ExecutingInterceptor(object target, ServiceDescriptor descr)
        {
            this.target = target;
            this.descr = descr;
        }

        #region IInterceptor

        public object Intercept(InvocationInfo invocation)
        {
            ExecutingInvocation inv = new ExecutingInvocation(target, descr, invocation);
            return inv.InvokeNext();
        }

        #endregion

    }
}
